/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Principal1.java
 *
 * Created on 01/03/2012, 21:25:39
 */
package gui;

/**
 *
 * @author Solano
 */
public class Principal1 extends javax.swing.JFrame {

    /** Creates new form Principal1 */
   
    
    public Principal1() {
        initComponents();
        this.setSize(700, 500);
        setVisible(true);
        this.setDefaultCloseOperation(EXIT_ON_CLOSE);
    }
    
    public TSinais getTSinaisPanel(){
        if (getContentPane() instanceof TSinais)
            return (TSinais) getContentPane();
        
        return null;
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jSair = new javax.swing.JMenuItem();
        jMenu3 = new javax.swing.JMenu();
        jMalhaAberta = new javax.swing.JMenuItem();
        jMalhaFechada = new javax.swing.JMenuItem();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setTitle("TANKER_CONTROL");

        jMenu1.setText("Opções");

        jSair.setText("Sair");
        jSair.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jSairActionPerformed(evt);
            }
        });
        jMenu1.add(jSair);

        jMenuBar1.add(jMenu1);

        jMenu3.setText("Ferramentas");
        jMenu3.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMenu3MouseClicked(evt);
            }
        });

        jMalhaAberta.setText("Malha Aberta");
        jMalhaAberta.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMalhaAbertaMouseClicked(evt);
            }
        });
        jMalhaAberta.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMalhaAbertaActionPerformed(evt);
            }
        });
        jMenu3.add(jMalhaAberta);

        jMalhaFechada.setText("Malha Fechada");
        jMalhaFechada.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jMalhaFechadaMouseClicked(evt);
            }
        });
        jMalhaFechada.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jMalhaFechadaActionPerformed(evt);
            }
        });
        jMenu3.add(jMalhaFechada);

        jMenuBar1.add(jMenu3);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 807, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGap(0, 575, Short.MAX_VALUE)
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

    private void jMenu3MouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMenu3MouseClicked
       
    }//GEN-LAST:event_jMenu3MouseClicked

    private void jMalhaAbertaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMalhaAbertaMouseClicked
        TSinais s = new TSinais();
        s.setVisible(true);
        this.setContentPane(s);
    }//GEN-LAST:event_jMalhaAbertaMouseClicked

    private void jMalhaAbertaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMalhaAbertaActionPerformed
       jMalhaAbertaMouseClicked(null);
    }//GEN-LAST:event_jMalhaAbertaActionPerformed

    private void jMalhaFechadaMouseClicked(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jMalhaFechadaMouseClicked
       
    }//GEN-LAST:event_jMalhaFechadaMouseClicked

    private void jMalhaFechadaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jMalhaFechadaActionPerformed
       TVariavel v = new TVariavel();
       v.setVisible(true);
       this.setContentPane(v);
    }//GEN-LAST:event_jMalhaFechadaActionPerformed

    private void jSairActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSairActionPerformed
       this.setDefaultCloseOperation(EXIT_ON_CLOSE);
       this.dispose();
       
    }//GEN-LAST:event_jSairActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Principal1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Principal1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Principal1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Principal1.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Principal1().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JMenuItem jMalhaAberta;
    private javax.swing.JMenuItem jMalhaFechada;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu3;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jSair;
    // End of variables declaration//GEN-END:variables

}   
      
        
        
